import { createPersistedState } from "pinia-plugin-persistedstate";

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: '2024-11-01',
  devtools: { enabled: true },

  runtimeConfig: {
    // 仅服务器端可用
    apiSecret: "123",
    // 客户端也可使用
    public: {
      apiBase: "https://api.jihw.top/web-api",
    },
  },

  css: ["~/assets/styles/index.scss"], // 全局样式
  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `@use "~/assets/styles/element/index.scss" as *;`,
          silenceDeprecations: ["legacy-js-api"],
        },
      },
    },
  },
  modules: [
    '@nuxtjs/tailwindcss',
    '@nuxt/icon',
    '@element-plus/nuxt',
    '@pinia/nuxt',
    'pinia-plugin-persistedstate/nuxt',
  ],
  elementPlus: { 
    importStyle: "scss",
  },
  tailwindcss: {
    config: {
      theme: {
        extend: {
          colors: {
            primary: "#0b5ce7",
          },
        },
      },
    },
  },
  pinia: {},
  imports: {
    autoImport:true,
    dirs: ['stores'], // 确保自动导入 stores 目录下的文件
  },
})
